package com.acme.chat.ui;

import java.awt.BorderLayout;
import java.awt.FlowLayout;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.border.EmptyBorder;

public class RoomSettingsDialog extends JDialog {

    private final JPanel contentPanel = new JPanel();
    private JTextField roomField;

    /**
     * Create the dialog.
     */
    public RoomSettingsDialog() {
        setBounds(100, 100, 241, 118);
        getContentPane().setLayout(new BorderLayout());
        contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
        getContentPane().add(contentPanel, BorderLayout.CENTER);
        contentPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 5));
        {
            JLabel roomLabel = new JLabel("Room name:");
            contentPanel.add(roomLabel);
        }
        {
            roomField = new JTextField();
            contentPanel.add(roomField);
            roomField.setColumns(10);
        }
        {
            JPanel okCancelPane = new JPanel();
            okCancelPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
            getContentPane().add(okCancelPane, BorderLayout.SOUTH);
            {
                JButton okButton = new JButton("OK");
                okButton.setActionCommand("OK");
                okCancelPane.add(okButton);
                getRootPane().setDefaultButton(okButton);
            }
            {
                JButton cancelButton = new JButton("Cancel");
                cancelButton.setActionCommand("Cancel");
                okCancelPane.add(cancelButton);
            }
        }
    }

}
